﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Mime;
using System.Text;
using ProjectWizardManagementv1.Infrastructure.Abstract;
using ProjectWizardManagementv1.Infrastructure.Concrete;
using ProjectWizardManagementv1.ViewModels.Concrete;

namespace ProjectWizardManagement.UnitTest
{
    public class UnitTestFileSystemWatcherHandler : IFileSystemWatcherHandler
    {
        public FileExplorerViewModel Files { get; set; }

        public void OnFileCreated(object sender, FileSystemEventArgs e)
        {
                var file = FileSystemFactory.ConstructFileHierarchy(e.FullPath);
                Files.AddFileToParentDirectory(file);
        }

        public void OnFileDeleted(object sender, FileSystemEventArgs e)
        {
                Files.RemoveFileFromParentDirectory(e.FullPath);
        }

        public void OnFileRenamed(object sender, RenamedEventArgs e)
        {
                Files.RenameFile(e.OldFullPath, e.FullPath);
        }
    }
}
